package cn.ztuo.bitrade.entity;

import com.alibaba.fastjson.JSON;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 撮合交易信息
 */
@Data
public class ContractTrade implements Serializable {
    private String symbol;
    //成交价
    private BigDecimal price;
    private String priceStr;
    //数量
    private BigDecimal amount;
    private String amountStr;
    //合约张数
    private BigDecimal nowp;
    private String nowpStr;
    //买的成交额
    private BigDecimal buyTurnover;
    //卖的成交额
    private BigDecimal sellTurnover;
    //方向
    private ContractOrderDirection direction;
    private String buyOrderId;
    private String sellOrderId;
    private Long time;
    //保证金率(交易量/(订单总量-已成交量))
    private BigDecimal buyBond;
    private BigDecimal sellBond;

    //1: 平台  2:用户
    private Integer type;

    @Override
    public String toString() {
        return  JSON.toJSONString(this);
    }
}
